﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace BaseTypesControlLib.Converters
{
    public class GaugeProgressConverter : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string lbl = (string)values[0];
            int progress = (int)values[1];
            int progressPercent = (int)values[2];
            bool lblAsProgr = (bool)values[3];
            bool noText = (bool)values[4];
            bool percent = (bool)values[5];

            if (noText)
                return null;

            string res = null;
            if (lblAsProgr)
                res = lbl;
            else
                res = string.Format("{0}", progress);
            if (percent)
                res = string.Format("{0} %", progressPercent);

            return res;
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
